package com.itheima;

import com.itheima.config.SpringConfig;
import com.itheima.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


public class AppForAnnotation {

    public static void main(String[] args) {
        //加载配置类
        ApplicationContext cx = new AnnotationConfigApplicationContext(SpringConfig.class);

        BookDao bookDao = cx.getBean("bookDao" , BookDao.class);

        System.out.println(bookDao);
    }
}
